package com.xuecheng.content.api;

import com.xuecheng.commons.model.vo.CoursePubVo;
import com.xuecheng.commons.model.vo.ResponseResult;
import com.xuecheng.commons.model.vo.TeachplanVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 课程feign
 */
@FeignClient("xc-content-service")
public interface ContentClient {
    //根据id查询课程发布对象
    @GetMapping("/coursePub/{id}")
    public ResponseResult<CoursePubVo> findById(@PathVariable("id")Long id);

    //根据id查询课程计划
    @GetMapping("/teachplan/{teachplanId}")
    public ResponseResult<TeachplanVo> findTeachplanById(@PathVariable("teachplanId")Long teachplanId);

    //根据课程名返回id集合
    @GetMapping("/coursePub/getName")
    public ResponseResult<List<Long>> findIdByName(@RequestParam String courseName);

    //根据workId查绑定的课程
    @GetMapping("/teachplan/work")
    public ResponseResult<String> findTitleByWorkId(@RequestParam Long workId);
}
